package com.xgzit.xgzmall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xgzit.common.utils.PageUtils;
import com.xgzit.xgzmall.member.entity.MemberEntity;
import com.xgzit.xgzmall.member.exception.EmailExistException;
import com.xgzit.xgzmall.member.exception.PhoneExistException;
import com.xgzit.xgzmall.member.exception.UserNameExistException;
import com.xgzit.xgzmall.member.vo.SocialUserVo;
import com.xgzit.xgzmall.member.vo.UserLoginVo;
import com.xgzit.xgzmall.member.vo.UserRegisterVo;

import java.util.Map;

/**
 * 会员
 *
 * @author xgz
 * @email 923904706@qq.com
 * @date 2021-03-20 17:12:08
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);
    /** 注册 **/
    void register(UserRegisterVo vo);

    /** 检查用户名是否唯一 */
    void checkUserNameUnique(String userName) throws UserNameExistException;

    /** 检查邮箱是否唯一 **/
    void checkEmailUnique(String email) throws EmailExistException;

    /** 检查手机号是否唯一 **/
    void checkPhoneUnique(String phone) throws PhoneExistException;

    /** 登录 **/
    MemberEntity login(UserLoginVo vo);

    /** 社交登录 **/
    MemberEntity login(SocialUserVo vo);
}

